package com.eslserver.to;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.Proxy;

@Entity
@Proxy(lazy = false)
@Table(name = "ESL_PUSH_SCHEDULE")
public class Schedule {
	private Integer scheduleID;
	private String name;
	private String description;
	private Date startTime;
	private Integer timeInterval;
	private transient ESL esl;
	private Image image;
	private Boolean repeat;
	private Boolean delete;
	private Date createDate;
	private Date modifyDate;

	public Schedule() {
	}

	public static Schedule createSchedule() {
		Schedule schedule = new Schedule();
		schedule.setDelete(false);
		return schedule;
	}

	@Id
	@Column(name = "esl_push_schedule_id")
	@GeneratedValue(generator = "increment")
	@GenericGenerator(name = "increment", strategy = "increment")
	public Integer getScheduleID() {
		return scheduleID;
	}

	public void setScheduleID(Integer scheduleID) {
		this.scheduleID = scheduleID;
	}

	@Column(name = "name")
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Column(name = "description")
	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	@Column(name = "start_time")
	public Date getStartTime() {
		return startTime;
	}

	public void setStartTime(Date startTime) {
		this.startTime = startTime;
	}

	@Column(name = "time_interval")
	public Integer getTimeInterval() {
		return timeInterval;
	}

	public void setTimeInterval(Integer timeInterval) {
		this.timeInterval = timeInterval;
	}

	@ManyToOne
	@JoinColumn(name = "esl_id_fk")
	public ESL getEsl() {
		return esl;
	}

	public void setEsl(ESL esl) {
		this.esl = esl;
	}

	@ManyToOne
	@JoinColumn(name = "esl_image_id_fk")
	public Image getImage() {
		return image;
	}

	public void setImage(Image image) {
		this.image = image;
	}

	@Column(name = "isRepeat")
	public Boolean isRepeat() {
		return repeat;
	}

	public void setRepeat(Boolean repeat) {
		this.repeat = repeat;
	}

	@Column(name = "isDelete")
	public Boolean isDelete() {
		return delete;
	}

	public void setDelete(Boolean delete) {
		this.delete = delete;
	}

	@Column(name = "create_date")
	public Date getCreateDate() {
		return createDate;
	}

	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}

	@Column(name = "modify_date")
	public Date getModifyDate() {
		return modifyDate;
	}

	public void setModifyDate(Date modifyDate) {
		this.modifyDate = modifyDate;
	}
}
